/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package commande.modeles.entity;

import java.io.Serializable;
import javax.persistence.*;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;

/**
 *
 * @author MAZID
 */
@Entity
public class Tva implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @NotNull
    @Column(name = "codeTVA", nullable = false)
    private Integer codeTVA;
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 10)
    @Column(name = "type", nullable = false, length = 10)
    private String type;
    @Basic(optional = false)
    @NotNull
    @Column(name = "pourcentage", nullable = false)
    private float pourcentage;

    public Tva() {
    }

    public Tva(Integer codeTVA) {
        this.codeTVA = codeTVA;
    }

    public Tva(Integer codeTVA, String type, float pourcentage) {
        this.codeTVA = codeTVA;
        this.type = type;
        this.pourcentage = pourcentage;
    }

    public Integer getCodeTVA() {
        return codeTVA;
    }

    public void setCodeTVA(Integer codeTVA) {
        this.codeTVA = codeTVA;
    }

    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }

    public float getPourcentage() {
        return pourcentage;
    }

    public void setPourcentage(float pourcentage) {
        this.pourcentage = pourcentage;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (codeTVA != null ? codeTVA.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Tva)) {
            return false;
        }
        Tva other = (Tva) object;
        if ((this.codeTVA == null && other.codeTVA != null) || (this.codeTVA != null && !this.codeTVA.equals(other.codeTVA))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "commande.modeles.entity.Tva[ codeTVA=" + codeTVA + " ]";
    }
    
}
